------------------------------------------------------------------------------------------------------------------------------------
      name:  plog_915
       log:  /accounts/projects/jr_ra/GRscarring/erratum/programs/analysis/fig_atcfx_time.log
  log type:  text
 opened on:  27 Nov 2024, 18:06:01

. ***************************************************************************************************************
. * fig_atcfx_time.do
. *
. * Make plot of time effects from A-T-C decomposition
. * Based on fig_atcfx.do, 1/21/2020
. *
. 
. 
. ***************************************************************************************************************  
. clear

. cap project, doinfo

. //cap notaproject
. if _rc==0 {
.         local pdir "`r(pdir)'"                                                      // the project's main dir.
.         local dofile "`r(dofile)'"                                                  // do-file's stub name
.         local sig {bind:{hi:[`dofile'.dta. RP : `dofile'.do, `c(current_date)']}}       // a signature in notes
.         local doasproject=1
. }

. else {
.         local pdir "~/GRscarring"
.         local dofile "fig_atcfx_time"
.         local doasproject=0
. }

. 
. set more off

. local rootdir "`pdir'"

. local thisdir "`pdir'"

. 
. local scratch "`pdir'/scratch"

. local rawdata "`pdir'/rawdata"

. local output "`pdir'/results"

. 
. set scheme s1color

. 
. if `doasproject'==1 {
.         project, uses(`scratch'/recessionlist.dta)
project GRscar_erratum > do-file uses: "/scratch/public/jr_ra/GRscarring2024/erratum/scratch/recessionlist.dta" filesig(1425014852:1
> 5851)
.         project, uses(`scratch'/extrapolate_coeffs.dta)
project GRscar_erratum > do-file uses: "/scratch/public/jr_ra/GRscarring2024/erratum/scratch/extrapolate_coeffs.dta" filesig(3506803
> 25:2415967)
. }

. 
. local depvars "empl rw_l log_pearnval_tc_r"

. 
.         *Get time effects from the basic A-T-C decomposition (model B - not extrapolated).
.         use if inlist(model, "mB1b") using `scratch'/runatc_coeffs, clear

.         keep if ivartype=="FV" & fvname=="year" 
(364 observations deleted)

.         rename fvval year

.         gen keep="A"

.         foreach v in `depvars' {
  2.           replace keep="B" if depvar=="`v'"
  3.         }
(41 real changes made)
(41 real changes made)
(39 real changes made)

.         keep if keep=="B"
(0 observations deleted)

.         drop keep

. 
.         gen month=ym(year, 7)

.         su month, meanonly

.         format month %tm

.         local fmonth=r(min)

.         local lmonth=r(max)

.         append using `scratch'/recessionlist

.         keep if recession==. | (month>=`fmonth'-6 & month<=`lmonth'+5) | month==.
(408 observations deleted)

.         tempfile base

.         save `base', replace
(file /tmp/St2868349.000004 not found)
file /tmp/St2868349.000004 saved as .dta format

. 
.         replace b=b*100 if depvar=="empl"
(40 real changes made)

.         gen zero=0

. 
.         twoway area recession month if recession<. & month>=186, yaxis(2) ytitle("", axis(2)) ylabel(none, axis(2)) color(gs13) ||
>  ///
>                line b month if depvar=="empl" & model=="mB1b", yaxis(1) lstyle(p1) || ///
>            line zero month if model=="mB1b" & depvar=="empl", lpattern(dot) lcolor(black) || ///
>                         , legend(off) ///
>                         ytitle("Employment rate in % (2007=0)") xtitle("Year") ///
>                         xlabel(246 "1980" 306 "1985" 366 "1990" 426 "1995" 486 "2000" 546 "2005" 606 "2010" 666 "2015" 726 "2020")
>   ///
>                         title("Year effects on employment" "from age-time-cohort decomposition") ///
>                         saving("`output'/`dofile'.gph", replace)   
file /accounts/projects/jr_ra/GRscarring/erratum/results/fig_atcfx_time.gph saved

. 
. if `doasproject'==1 project, creates(`output'/`dofile'.gph)
project GRscar_erratum > do-file creates: "results/fig_atcfx_time.gph" filesig(2947293518:18221)

.  
. 
end of do-file
      name:  plog_915
       log:  /accounts/projects/jr_ra/GRscarring/erratum/programs/analysis/fig_atcfx_time.log
  log type:  text
 closed on:  27 Nov 2024, 18:06:01
------------------------------------------------------------------------------------------------------------------------------------
